version: "3.9"
services:
  pgsql:
    image: postgres:13-alpine
    container_name:  docker-cont
    restart: always
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      PGDATA: /var/lib/postgresql/data
    volumes:
      - pgsql-data:/var/lib/postgresql/data
    ports:
      - "5010:5432"

  pgadmin:
    image: dpage/pgadmin4:4.18
    container_name:  PgAdmin
    restart: always
    environment:
      PGADMIN_DEFAULT_EMAIL: viktor@mail.com
      PGADMIN_DEFAULT_PASSWORD: postgres
      PGADMIN_LISTEN_PORT: 80
    ports:
      - "5011:80"
    volumes:
      - pgadmin-data:/var/lib/pgadmin
    links:
      - pgsql:pgsql-server

volumes:
  pgsql-data:
  pgadmin-data: